package com.clubs.coding.Controller;

import com.clubs.coding.Service.AthLeaveService;
import com.clubs.coding.Service.SynthesizeService;
import com.clubs.coding.common.ApiRestResponse;
import com.clubs.coding.exception.ImoocMallException;
import com.clubs.coding.exception.ImoocMallExceptionEnum;
import com.clubs.coding.model.request.AthLeaveReq;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;

/**
 *
 综合控制器
 */
@Controller
@ResponseBody
@RequestMapping("/admin")
public class SynthesizeController {
@Autowired
    SynthesizeService synthesizeService;
/**
 * 后台请假列表
 * */
@PostMapping("/leave/list")
public ApiRestResponse list(Integer pageNum, Integer pageSize,Integer type){
    PageInfo pageInfo = synthesizeService.list(pageNum, pageSize,type);
    return ApiRestResponse.success(pageInfo);
}
    /**
     * 后台请假审核
     * */
    @PostMapping("/leave/check")
public ApiRestResponse check_leave(Integer id, Integer type){
    synthesizeService.check_leave(id, type);
    return ApiRestResponse.success();
}

}
